import { anchorscroll } from "./anchorscroll";

export function sidebarsubheaderclicklistener(e: Event) {
    if (!(e instanceof MouseEvent)) {
        return;
    }
    let target = e.target;
    console.log(e);

    if (
        target &&
        target instanceof HTMLAnchorElement &&
        target.classList.contains("sidebar-sub-header")
    ) {
        console.log(target);
        //@ts-ignore
        requestIdleCallback(() => {
            requestAnimationFrame(() => {
                anchorscroll();
            });
        });
    }
}
